package charts.plot
{
	import flash.display.Sprite;
	
	public class PieChartPlotArea extends PlotArea
	{
		// Children
		private var _drawingClip:Sprite;
		
		
		public function PieChartPlotArea()
		{
			super();
		}
		
		public function get drawingClip():Sprite
		{
			return this._drawingClip;
		}
		
		override protected function createChildren():void
		{
			super.createChildren();
			if(!_drawingClip)
			{
				_drawingClip = new Sprite();
				this.addChild(_drawingClip);
			}
			
		}
		
		override protected function updateDisplayList(unscaledWidth:Number,
                                        			  unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			
			if(_drawingClip)
			{
				var centerPointX:Number = unscaledWidth / 2;
				var centerPointY:Number = unscaledHeight / 2;
				var margin:Number = 20;
				var radius:Number = (Math.min(unscaledWidth,unscaledHeight) - margin) / 2;
				_drawingClip.graphics.clear();
				_drawingClip.graphics.lineStyle(3,0xff00ff,1.0);
				_drawingClip.graphics.beginFill(0xFF3456,1.0);
				_drawingClip.graphics.drawCircle(centerPointX,centerPointY,radius);
				_drawingClip.graphics.endFill();
			}
			
			
		}
		/*
		
		
		override protected function measure():void
		{
			super.measure();
		}
		override protected function commitProperties():void
		{
			super.commitProperties();
		}
		override public function styleChanged(styleProp:String):void
    	{
    		super.styleChanged(styleProp);
    	} */
		
	}
}